var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/businessComponent/help/SingleHelp.tsx
var SingleHelp_exports = {};
__export(SingleHelp_exports, {
  HelpSelect: () => HelpSelect,
  SingleHelp: () => SingleHelp
});
module.exports = __toCommonJS(SingleHelp_exports);
var import_react = __toESM(require("react"));
var import_functionalComponent = require("../../functionalComponent");
var import_util = require("../../util");
var import_common = require("./common");
function HelpContent() {
  const {
    ok,
    contentParams: { helpId, footer, columns, helpTitle },
    locale,
    randomKey
  } = (0, import_react.useContext)(import_functionalComponent.HelpContext);
  const { activeKey, setActiveKey, tabBarExtraContent, advancedSearch, renderTreeList, getResult, changeCommonData } = (0, import_common.useCtx)(false);
  const renderTable = (0, import_util.useRefCallback)((index, listRequest) => {
    if (index === "treeStyle") {
      return renderTreeList();
    }
    return /* @__PURE__ */ import_react.default.createElement(
      import_functionalComponent.Table,
      {
        id: `${helpId}_${randomKey}_${index}`,
        style: {
          borderStyle: "solid",
          borderColor: "var(--border-color-split, #f0f0f0)",
          borderWidth: "0 1px 1px 1px"
        },
        columns,
        pagination: { height: 32, align: "left" },
        onRow: () => ({
          onDoubleClick() {
            ok(getResult());
          }
        }),
        rowSelected: true,
        headerMenu: false,
        request: listRequest
      }
    );
  });
  const items = (0, import_common.useTabItems)({ renderTable });
  return /* @__PURE__ */ import_react.default.createElement(import_util.Layout, null, /* @__PURE__ */ import_react.default.createElement(import_functionalComponent.BaseHelp.Header, { title: helpTitle || locale.singleTitle }, tabBarExtraContent), advancedSearch, /* @__PURE__ */ import_react.default.createElement(import_util.Layout.Flex, { direction: "column", style: { padding: "0 5px" } }, /* @__PURE__ */ import_react.default.createElement(import_functionalComponent.Tabs, { className: "fit-height", size: "small", activeKey, onChange: setActiveKey, items })), /* @__PURE__ */ import_react.default.createElement(import_functionalComponent.BaseHelp.Footer, { getResult }, /* @__PURE__ */ import_react.default.createElement(import_functionalComponent.Button, { style: { marginLeft: 5 }, onClick: changeCommonData }, activeKey === "commonData" ? locale.DelCommonUse : locale.AddCommonUse), footer && /* @__PURE__ */ import_react.default.createElement("span", { children: footer })));
}
var SingleHelp = (0, import_util.compHoc)((props) => {
  const [helpProps, modalProps] = (0, import_common.useHelp)(props);
  const { width, height } = (0, import_util.getGlobalConfig)().default.helpConfig;
  return /* @__PURE__ */ import_react.default.createElement(import_functionalComponent.BaseHelp, { ...helpProps, multiple: false, helpContent: HelpContent, modalProps: { width, height, ...modalProps } });
}, "SingleHelp");
var HelpSelect = import_react.default.forwardRef(
  (props, ref) => {
    return /* @__PURE__ */ import_react.default.createElement(SingleHelp, { ...props, ref, modal: false });
  }
);
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  HelpSelect,
  SingleHelp
});
